package com.widevision.ListActivity;

import net.widevision.android.R;
import android.app.Activity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
import android.widget.Toast;

public class PopupwindowActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
    LayoutInflater layoutInflater = (LayoutInflater)getBaseContext().getSystemService(LAYOUT_INFLATER_SERVICE);  
    View popupView = layoutInflater.inflate(R.layout.popup, null);  
    LinearLayout tweetlayout=(LinearLayout) findViewById(R.id.tweetoption);
//    LinearLayout optionlayout=(LinearLayout) findViewById(R.id.optionLayout);
             final PopupWindow popupWindow = new PopupWindow(popupView,LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);  
            
             ImageView viewprofile=(ImageView)popupView.findViewById(R.id.tw_reply);
             viewprofile.setOnClickListener(new ImageView.OnClickListener(){

				public void onClick(View v) {
					// TODO Auto-generated method stub
					 Toast.makeText(PopupwindowActivity.this, 
						        "viewprofile", Toast.LENGTH_LONG).show();
				}
             });
             
             ImageView like=(ImageView)popupView.findViewById(R.id.tw_retweet);
             like.setOnClickListener(new ImageView.OnClickListener(){

				public void onClick(View v) {
					// TODO Auto-generated method stub
					Toast.makeText(PopupwindowActivity.this, 
					        "like", Toast.LENGTH_LONG).show();
				}
             });
             ImageView comment=(ImageView)popupView.findViewById(R.id.tw_favorite);
             comment.setOnClickListener(new ImageView.OnClickListener(){

				public void onClick(View v) {
					// TODO Auto-generated method stub
					Toast.makeText(PopupwindowActivity.this, 
					        "comment", Toast.LENGTH_LONG).show();
				}
             });
             ImageView directmessage=(ImageView)popupView.findViewById(R.id.tw_replies);
             directmessage.setOnClickListener(new ImageView.OnClickListener(){

				public void onClick(View v) {
					// TODO Auto-generated method stub
					Toast.makeText(PopupwindowActivity.this, 
					        "directmessage", Toast.LENGTH_LONG).show();
				}
             }); 
             
             ImageView xbutt=(ImageView)popupView.findViewById(R.id.tw_msg);
             xbutt.setOnClickListener(new ImageView.OnClickListener(){

				public void onClick(View v) {
					// TODO Auto-generated method stub
					popupWindow.dismiss();
				}
             });
             popupWindow.showAsDropDown(tweetlayout,2,160);
         
  
    }
}